package org.hismig.utils;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @declare: //TODO <br />
 *           This class created by Vansion.Hopihit on 2012-07-04 <br />
 *           <a href="mailto:vansionhopihit@gmail.com">Contact Me</a>
 * @version 1.0
 * @author Vansion.Hopihit
 * 
 */
public class ClassLoaderTool {

	private static Logger logger = LoggerFactory
			.getLogger(ClassLoaderTool.class);

	public static Object load(String className) {

		try {

			return ClassLoaderTool.class.getClassLoader().loadClass(className)
					.newInstance();

		} catch (ClassNotFoundException e) {
			logger.error(e.getMessage(), e);
			return null;
		} catch (InstantiationException e) {
			logger.error(e.getMessage(), e);
			return null;
		} catch (IllegalAccessException e) {
			logger.error(e.getMessage(), e);
			return null;
		} catch (Throwable e) {
			logger.error(e.getMessage(), e);
			return null;
		}
	}

}
